﻿<UserControl x:Class="VmroleAuthor.Views.ViewDefResourcesContainerView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignWidth="900">
    <UserControl.Resources>
        <Style x:Key="MyButtonStyle" TargetType="Button">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Margin" Value="4" />
            <Setter Property="Height" Value="28" />
            <Setter Property="BorderThickness" Value="0"></Setter>
        </Style>
    </UserControl.Resources>
    <Grid VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="30" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="6"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="6"/>
        </Grid.ColumnDefinitions>

        <Label Grid.Row="1" Grid.Column="0"   Content="Add resource (Language Code)"/>
        <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="2">
            <ComboBox x:Name="NewLocalizedResourceToBeAdded" VerticalAlignment="Center" Height="28" MinWidth="600" HorizontalAlignment="Left" IsEditable="True" ItemsSource="{Binding  AvailableLocalizedRegionCodes}" SelectedItem="{Binding NewLocalizedResourceToBeAdded}" Text="{Binding NewLocalizedResourceToBeAdded, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}"/>          
            <Button x:Name="ButtonAddNewTag" Style="{StaticResource MyButtonStyle}" HorizontalAlignment="Left" Command="{Binding AddLocalizedResourceCommand}"  CommandParameter="{Binding NewLocalizedResourceToBeAdded}">
                <Image Source="../Img/addgreen.png"/>
            </Button>
        </StackPanel>
        <ContentPresenter Grid.Row="2" Grid.Column="2" Content="{Binding ElementName=NewLocalizedResourceToBeAdded, Path=(Validation.Errors).CurrentItem}" />
    </Grid>
</UserControl>
